import { Base } from '../base.js';

class User extends Base {
	
	getDetail(){
		var params = {
			url: 'v1/user/detail'
		}
		return this.request(params);
	}
	
	/**
	 * 更新头像
	 */
	updateAvatar(path){
		var params = {
			url: 'v1/user/updateAvatar',
			path: path
		}
		return this.upload(params);
	}
	
	/**
	 * 更新用户昵称
	 */
	updateNickname(nick_name){
		var params = {
			type: 'POST',
			url: 'v1/user/updateNickname',
			data: {nick_name: nick_name}
		}
		return this.request(params);
	}
	
	/**
	 * 更新用户
	 */
	updateUserInfo(userInfo){
		var params = {
			type: 'POST',
			url: 'v1/user/updateUserInfo',
			data: {userInfo: userInfo}
		}
		return this.request(params);
	}
	
}

export { User }

